// 2843. 统计对称整数的数目
// AC：https://leetcode.cn/problems/count-symmetric-integers/submissions/621100953/

class Solution {
public:
    int countSymmetricIntegers(int low, int high) {
        int ans=0;
        for(int a=low;a<=high;++a){
            if(a<100&&a%11==0)
                ans++;
            else if(1000<a&&a<10000){
                int l=(a/1000)+(a/100)%10;
                int r=(a%100)/10+a%10;
                if(l==r)
                    ans++;
            }
        }
        return ans;
    }
};